<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title></title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <link rel="shortcut icon" href="favicon.ico">
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="text-center row">
        <div class="form-group">
            <div class="col-sm-10">
                <input class="form-control" id="keyword" value="{{$keyword}}">
            </div>
            <div class="col-sm-2">
                <a class="btn btn-success" id="search-btn">搜索</a>
            </div>

        </div>
        <table class="table table-bordered text-center">
            <thead class="text-center">
            <tr>
                <th>ID</th>
                <th>活动名称</th>
                <th>活动时间</th>
                <th>关联群体</th>
                <th>活动奖励</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            @foreach($list as $activity)
                <tr>
                    <td>{{$activity->id}}</td>
                    <td>{{$activity->name}}</td>
                    <td>{{date('Y/m/d',$activity->start_time)}} -- {{date('Y/m/d',$activity->end_date )}}</td>
                    <td>{{$activity->user_filter}}</td>
                    <td>{{$activity->rewards}}</td>
                    <td>
                        @if($activity->status == 0)
                            <a href="/ceb/activities/check?id={{$activity->id}}">审核</a> |
                            <a href="/ceb/activities/edit?id={{$activity->id}}">编辑</a> |
                            <a href="/ceb/activities/delete?id={{$activity->id}}">删除</a> |
                        @else
                            <b>审核通过</b> |
                        @endif
                            <a href="/ceb/activities/detail?id={{$activity->id}}">查看报告</a>
                    </td>
                </tr>
            @endforeach
            </tbody>
        </table>
        @include('wiget.pager',[
            'page' => $page,
            'page_size' => $size,
            'count' => $count,
            'show_count' => 10,
            'path' => url('/ceb/activities/index?keyword=' . $keyword)
        ])
    </div>
        <a class="btn btn-success" href="/ceb/activities/create">添加活动</a>
</div>
<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/js/jquery.cookie.js"></script>
<!-- 自定义js -->
<script src="/js/content.js?v=1.0.0"></script>

<!-- iCheck -->
<script src="/js/plugins/iCheck/icheck.min.js"></script>
<script src="/js/plugins/layer/layer.min.js"></script>
<script src="/js/common.js"></script>
<script>

    $(document).ready(function () {

        $('#search-btn').on('click',function(){
            var keyword = $('#keyword').val();
            go_page('/ceb/activities/index',{keyword:keyword});
        });
    });
</script>

</body>

</html>
